﻿using PetaPoco;
using PmSoft;
using PmSoft.Caching;
using System.ComponentModel;

namespace Modules.System.Role
{
    /// <summary>
    /// 用户角色关系
    ///</summary>
    [TableName("sys_user_role")]
    [Description("用户角色关联表")]
    [PrimaryKey("id", AutoIncrement = true)]
    [CacheSetting(true, PropertyNamesOfArea = "UserId,RoleId")]
    [Serializable]
    public class SysUserRole : IEntity
    {
        [Column("id")]
        public int Id { get; set; }

        /// <summary>
        ///
        ///</summary>
        [Column("user_id")]
        public int UserId { get; set; }

        /// <summary>
        ///
        ///</summary>
        [Column("role_id")]
        public int RoleId { get; set; }

        #region IEntity 成员

        [Ignore]
        object IEntity.EntityId { get { return Id; } }

        #endregion IEntity 成员
    }
}